<?php
/**
 * Created by PhpStorm.
 * User: zhuyujun
 * Date: 2017/10/26
 * Time: 11:18
 */

namespace App\Eloquent\Ygt;

use Framework\BaseClass\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;


class ProcessOrdertype extends DbEloquent
{
    use SoftDeletes;
    protected $dates = ['deleted_at'];
    protected $table = 'ygt_process_ordertype';

    public function addProcessOrderType($data){
        foreach ($data as $key => $val){
            $orderProcess = self::updateOrCreate(['ordertype_id' => $val['ordertype_id'],'process_id'=>$val['process_id'],'step_number'=>$val['step_number']],$val);
        }
        return true;

    }

/*    public static function setWithField(){
        return ['nextProcess'];
    }

    public function nextProcess(){
        return $this->hasMany('App\Eloquent\Ygt\ProcessOrdertype', 'prev_step');
    }*/

}